package com.gistmap.bean;

import com.gistmap.util.HTMLSpirit;
import org.springframework.format.annotation.DateTimeFormat;
import java.sql.Date;

/**
 * Created by Administrator on 2017/4/7.
 */
public class Article {
    private int id;
    private String title;
    private String content;
    private int uid;
    @DateTimeFormat( pattern = "yyyy-MM-dd" )
    private Date createTime;

    private String abst;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
        String temp = HTMLSpirit.delHTMLTag(content);
        if (temp.length() > 33)
            temp = temp.substring(0,30)+"...";
        setAbst(temp);

    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getAbst() {
        return abst;
    }

    public void setAbst(String abst) {
        this.abst = abst;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", uid=" + uid +
                ", createTime=" + createTime +
                '}';
    }
}
